#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import json
url = 'http://httpbin.org/post'
body = {"member_list_username": "1557185851113", "member_list_email": "3632271112121@qq.com", "password": "123456","repassword":"123456"}
headers = {
'content-type': "application/json; charset=utf-8"
, 'Server	': 'Apache/2.4.39 (Win32) OpenSSL/1.0.2r mod_fcgid/2.3.9a mod_log_rotate/1.02'
}
#print type(body)
#print type(json.dumps(body))
# 这里有个细节，如果body需要json形式的话，需要做处理
# 可以是data = json.dumps(body)
response = requests.post(url, data = json.dumps(body), headers = headers)
# 也可以直接将data字段换成json字段，2.4.3版本之后支持
# response  = requests.post(url, json = body, headers = headers)
# 返回信息
print response.text
# 返回响应头
print response.status_code
